<div class="dux-tools">
  <div class="bread-head">广告管理 <span class="small">管理网站经常变换的图片</span> </div>
  <br>
  <div class="tools-function clearfix">
    <div class="float-left"> <a class="button button-small bg-main icon-list" href="__URL__"> 广告列表</a> </div>
    <div class="button-group float-right"> <a class="button button-small bg-dot icon-plus dropdown-toggle"> 添加 <span class="downward"></span></a>
      <ul class="drop-menu pull-right">
        <li><a href="__URL__/add">添加广告</a></li>
      </ul>
    </div>
  </div>
</div>
<div class="admin-main">
    <div class="panel dux-box">
      <div class="table-responsive">
        <table id="table" class="table table-hover ">
          <tbody>
            <tr>
              <th width="100">编号</th>
              <th width="*">广告类型</th>
              <th width="*">广告名称</th>
              <!--<th width="*"></th>-->
              <th width="*">广告宽高</th>
              <th width="200">操作</th>
            </tr>
            <!--foreach:{$list $v}-->
            <tr>
              <td>{$v.id}</td>
              <td><?php if($v['type']==1){echo '图片';}else if($v['type']==2){echo 'Flash';}else if($v['type']==3){echo '文字';}else if($v['type']==4){echo '视频';}else if($v['type']==5){echo '自定义代码';}else{echo '多图轮播';} ?></td>
              <td><?php echo $v['name']; ?></td>

              <td><?php echo '宽：'.$v['adsw'].'PX&nbsp;&nbsp;高：'.$v['adsh'].'PX'; ?></td>
              <td><?php if(model('user_group')->model_power('ads','edit')){ ?>
                <a class="button bg-blue button-small icon-pencil" href="__URL__/edit/id-{$v.id}" title="修改"></a>
                <?php } ?>
                <?php if(model('user_group')->model_power('ads','del')){ ?>
                <a class="button bg-red button-small icon-trash-o js-del" href="javascript:;" onclick="del('{$v.id}',this)" title="删除"></a>
                <?php } ?></td>
            </tr>
            <!--{/foreach}-->
          </tbody>
        </table>
      </div>
    </div>
  <script>
//自定义变量
function del(id,obj) {
	var obj;
	ajaxpost({
		name:'删除此广告？',
		url:"__URL__/del",
		data:{id: id},
		tip:1,
		success:function(){
			$(obj).parent().parent().remove();
		}
	});
}
</script> 
</div>
